constraintlayout: Make sure guides get their constraints
authorMatthias Clasen <mclasen@redhat.com>
Fri, 30 Oct 2020 18:59:08 +0000 (14:59 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 30 Oct 2020 19:04:13 +0000 (15:04 -0400)
When using GtkBuilder to create constraints and guides,
the layout manager is already rooted when the guides get
created, and we were forgetting to create the guides
constraints in this case. Fix it by adding a call to
gtk_constraint_guide_update().

This was showing up in the new builder-based constraints
demo as the guide not having the expected effect.

gtk/gtkconstraintlayout.c

index 86ae56ce06797bc4e2cc1eb49cc10a820c39234d..e5d6037962a0aaf0fab4abbb9b2a4b5dde837bec 100644 (file)
@@ -1867,7 +1867,10 @@ gtk_constraint_layout_add_guide (GtkConstraintLayout *layout,
   if (layout->guides_observer)
     g_list_store_append (layout->guides_observer, guide);
 
+  gtk_constraint_guide_update (guide);
+
   gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (layout));
+
 }
 
 /**